package com.tyc.controller;

import com.tyc.annotation.Limiter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类描述
 *
 * @author tyc
 * @version 1.0
 * @date 2022-10-20 14:16:17
 */
@RestController
public class RedisController {
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    /**
     * 利用redis 实现签到功能
     */
    @PostMapping("/sign")
    public void sign(){
//        stringRedisTemplate.opsForValue().setBit()
    }

    @Limiter(1)
    @GetMapping("/limit")
    public String limit(){
        return "SUCCESS";
    }
}
